import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:part_time_job_pro/common/utils/common.dart';

class AppColor {
  /// 页面背景颜色
  static const Color scaffoldBackground = Color.fromRGBO(255, 255, 255, 1);

  /// 主要背景颜色
  static const Color primaryBackground = Color.fromRGBO(254, 115, 22, 1);

  /// 主要文本颜色
  static const Color primaryText = Color.fromRGBO(51, 51, 51, 1);

  /// 次要文本颜色
  static const Color secondaryText = Color.fromRGBO(116, 120, 141, 1);

  /// 高亮颜色
  static const Color accentColor = Color.fromRGBO(254, 115, 22, 1);

  /// 次要颜色
  static const Color secondaryColor = Color.fromRGBO(222, 227, 255, 1);

  /// 警告颜色
  static const Color warnColor = Color.fromRGBO(255, 184, 34, 1);

  /// 边框颜色
  static const Color borderColor = Color.fromRGBO(222, 227, 255, 1);

  static const Color pinkColor = Color.fromRGBO(247, 120, 102, 1);

  static const Color yellowColor = Color.fromRGBO(255, 184, 34, 1);

  ///字体大小、颜色-共有属性
  static double xxxSmallFontSize = 10.sp;
  static double xxSmallFontSize = 12.sp;
  static double xSmallFontSize = 14.sp;
  static double smallFontSize = 16.sp;
  static double commonFontSize = 18.sp;
  static double normalFontSize = 20.sp;
  static double largeFontSize = 22.sp;
  static double xLargeFontSize = 24.sp;
  static double xxLargeFontSize = 26.sp;
  static double xxxLargeFontSize = 28.sp;
  static double hugeFontSize = 32.sp;
  static double xHugeFontSize = 34.sp;
  static double xxHugeFontSize = 36.sp;
  static double xxxHugeFontSize = 38.sp;

  //普通模式
  ///白色
  static const Color norTextColors = Color.fromRGBO(0, 0, 0, 1);
  static const Color norBlackColors = Colors.black;
  static const Color norBlack01Colors = Color.fromRGBO(33, 33, 33, 1.0);

  ///白色
  static const Color norWhiteColor = Colors.white;
  static const Color norWhite01Color = Color.fromRGBO(250, 250, 250, 1);
  static const Color norWhite02Color = Color.fromRGBO(246, 247, 249, 1);
  static const Color norWhite03Color = Color.fromRGBO(255, 236, 240, 1);
  static const Color norWhite04Color = Color.fromRGBO(242, 243, 245, 1);
  static const Color norWhite05Color = Color.fromRGBO(254, 244, 234, 1);
  static const Color norWhite06Color = Color.fromRGBO(241, 242, 246, 1);
  static const Color norWhite07Color = Color.fromRGBO(245, 247, 250, 1);
  static const Color norWhite08Color = Color.fromRGBO(246, 247, 249, 1);
  static const Color norWhite09Color = Color.fromRGBO(247, 247, 247, 1);
  static const Color norWhite10Color = Color.fromRGBO(218, 218, 218, 0.65);

  ///灰色
  static const Color norGrayColor = Color.fromRGBO(187, 187, 187, 1);
  static const Color norGray01Color = Color.fromRGBO(245, 245, 245, 1);
  static const Color norGray02Color = Color.fromRGBO(161, 161, 162, 1.0);
  static const Color norGray03Color = Color.fromRGBO(112, 112, 112, 1);
  static const Color norGray04Color = Color.fromRGBO(86, 86, 86, 1);
  static const Color norGray05Color = Color.fromRGBO(67, 67, 68, 1);
  static const Color norGray06Color = Color.fromRGBO(194, 193, 193, 0.5);
  static const Color norGray07Color = Color.fromRGBO(239, 239, 239, 0.75);
  static const Color unselectedLabelColor = Color.fromRGBO(100, 100, 100, 1);
  static const Color diabledButtonColor = Color.fromRGBO(161, 161, 162, .5);

  ///粉色（主题色）
  static const Color norPink02Colors = Color.fromRGBO(255, 154, 184, 1);
  static const Color norPink03Colors = Color.fromRGBO(133, 61, 83, 1);
  static const Color norPink04Colors = Color.fromRGBO(255, 102, 156, 1);
  static const Color norPink05Colors = Color.fromRGBO(177, 143, 157, 1);
  static const Color norPink06Colors = Color.fromRGBO(236, 114, 153, 1);
  static const Color norPink07Colors = Color.fromRGBO(226, 134, 159, 1);
  static const Color norPink08Colors = Color.fromRGBO(217, 121, 151, 1);

  //蓝色
  static const Color norBlue01Colors = Color.fromRGBO(34, 162, 230, 1);
  static const Color norBlue02Colors = Color.fromRGBO(9, 117, 208, 1.0);
  static const Color norBlue03Colors = Color.fromRGBO(51, 62, 84, 1);
  static const Color norBlue04Colors = Color.fromRGBO(39, 97, 243, 1.0);
  static const Color norBlue05Colors = Color.fromRGBO(55, 74, 217, 1);
  static const Color norBlue06Colors = Color.fromRGBO(53, 94, 243, 0.5019607843137255);

  ///黄色
  static const Color norMainThemeColors = Color.fromRGBO(254, 115, 22, 1);
  static const Color norYellow01Colors = Color.fromRGBO(245, 185, 37, 1);
  static const Color norYellow02Colors = Color.fromRGBO(245, 176, 56, 1);
  static const Color norYellow03Colors = Color.fromRGBO(234, 154, 93, 1);
  static const Color norYellow04Colors = Color.fromRGBO(236, 124, 17, 1.0);
  static const Color norYellow05Colors = Color.fromRGBO(114, 89, 27, 1);
  static const Color norYellow06Colors = Color.fromRGBO(234, 154, 93, 0.5);

  ///红色
  static const Color norRedColors = Color.fromRGBO(238, 5, 5, 1.0);

  ///绿色
  static const Color norGreen01Colors = Color.fromRGBO(16, 210, 105, 1);

  static const transparent = Colors.transparent;
  static const white = Colors.white;
  static const black = Colors.black;
  static const blue = Colors.blue;
  static const red = Colors.red;
  static const green = Colors.green;
  static const gray = Colors.grey;
  static const yellow = Colors.yellow;
  static const orange = Colors.orange;

  static const grayEAEAEA = Color(0xFFEAEAEA);
  static const grayF8F8F8 = Color(0xFFF8F8F8);
  static const gray8A8D92 = Color(0xFF8A8D92);
  static const gray626670 = Color(0xFF626670);
  static const grayF4F4F4 = Color(0xFFF4F4F4);
  static const grayACACAC = Color(0xFFACACAC);
  static const grayE6E9F0 = Color(0xFFE6E9F0);
  static const grayE8E8E8 = Color(0xFFE8E8E8);
  static const grayC3C2C2 = Color(0xFFC3C2C2);
  static const grayF1F2F3 = Color(0xFFF1F2F3);
  static const grayF5F6F8 = Color(0xFFF5F6F8);
  static const grayD8D8D8 = Color(0xFFD8D8D8);
  static const gray8A8A8A = Color(0xFF8A8A8A);
  static const grayF9F9F9 = Color(0xFFF9F9F9);
  static const grayF7F7F7 = Color(0xFFF7F7F7);
  static const grayDDDDDD = Color(0xFFDDDDDD);
  static const grayBBBBBB = Color(0xFFBBBBBB);
  static const grayB5B5B5 = Color(0xFFB5B5B5);
  static const grayE6E6E6 = Color(0xFFE6E6E6);
  static const gray989694 = Color(0xFF989694);
  static const grayA2A3A4 = Color(0xFFA2A3A4);
  static const grayA7A7AA = Color(0xFFA7A7AA);
  static const gray929398 = Color(0xFF929398);
  static const grayE2E2E2 = Color(0xFFE2E2E2);
  static const grayF3F3F3 = Color(0xFFF3F3F3);
  static const grayEDEDED = Color(0xFFEDEDED);
  static const grayCFCFCF = Color(0xFFCFCFCF);
  static const grayFAFAFA = Color(0xFFFAFAFA);
  static const grayF2F2F2 = Color(0xFFF2F2F2);
  static const grayCCCCCC = Color(0xFFCCCCCC);
  static const grayEBEBEB = Color(0xFFEBEBEB);

  static const black333333 = Color(0xFF333333);
  static const black121213 = Color(0xFF121213);
  static const black564F46 = Color(0xFF564F46);
  static const black1A1A1B = Color(0xFF1A1A1B);
  static const black34322E = Color(0xFF34322E);
  static const black666666 = Color(0xFF666666);
  static const black999999 = Color(0xFF999999);
  static const black1C1C1C = Color(0xFF1C1C1C);
  static const black0D0011 = Color(0xFF0D0011);
  static const black191919 = Color(0xFF191919);
  static const black242424 = Color(0xFF242424);
  static const black36383E = Color(0xFF36383E);
  static const black3F3F3F = Color(0xFF3F3F3F);
  static const black3D2113 = Color(0xFF3D2113);

  static const redFF0000 = Color(0xFFFF0000);
  static const redFF5658 = Color(0xFFFF5658);
  static const redFFEEEA = Color(0xFFFFEEEA);
  static const redFA0000 = Color(0xFFFA0000);
  static const redFA3F40 = Color(0xFFFA3F40);
  static const redFF4F47 = Color(0xFFFF4F47);
  static const redF50000 = Color(0xFFF50000);
  static const redEA424C = Color(0xFFEA424C);
  static const redDF3731 = Color(0xFFDF3731);
  static const redEE2F27 = Color(0xFFEE2F27);
  static const redFF2828 = Color(0xFFFF2828);
  static const redC92323 = Color(0xFFC92323);

  static const blue046AD0 = Color(0xFF046AD0);
  static const blueD8E6FF = Color(0xFFD8E6FF);
  static const blue0D4BEE = Color(0xFF0D4BEE);
  static const blueF3F4FA = Color(0xFFF3F4FA);
  static const blueEFF4FF = Color(0xFFEFF4FF);
  static const blueE1E9FF = Color(0xFFE1E9FF);
  static const blue0988FF = Color(0xFF0988FF);
  static const blue0680F3 = Color(0xFF0680F3);
  static const blueD6EBFF = Color(0xFFD6EBFF);
  static const blue2495FF = Color(0xFF2495FF);
  static const blue166EC2 = Color(0xFF166EC2);
  static const blue158EFF = Color(0xFF158EFF);
  static const blue2B7ECB = Color(0xFF2B7ECB);
  static const blue008BFF = Color(0xFF008BFF);
  static const blue2294FF = Color(0xFF2294FF);
  static const blueF0F8FF = Color(0xFFF0F8FF);
  static const blueCAE9FF = Color(0xFFCAE9FF);

  static const green5CE606 = Color(0xFF5CE606);
  static const greenE1FFE1 = Color(0xFFE1FFE1);
  static const green0FC468 = Color(0xFF0FC468);
  static const green00CF99 = Color(0xFF00CF99);
  static const greenE8FFF9 = Color(0xFFE8FFF9);
  static const green21C17C = Color(0xFF21C17C);
  static const green31C923 = Color(0xFF31C923);

  static const yellowFFF395 = Color(0xFFFFF395);
  static const yellowFAEAD3 = Color(0xFFFAEAD3);
  static const yellowF2E2CB = Color(0xFFF2E2CB);
  static const yellowFAE0B9 = Color(0xFFFAE0B9);
  static const yellowFFF4ED = Color(0xFFFFF4ED);
  static const yellowFFF0E7 = Color(0xFFFFF0E7);
  static const yellowFFF1DE = Color(0xFFFFF1DE);
  static const yellow836735 = Color(0xFF836735);
  static const yellow89652B = Color(0xFF89652B);
  static const yellowA37B33 = Color(0xFFA37B33);

  static const orangeFFF1E3 = Color(0xFFFFF1E3);
  static const orangeFFA200 = Color(0xFFFFA200);
  static const orangeFFF1DE = Color(0xFFFFF1DE);
  static const orangeFE866F = Color(0xFFFE866F);
  static const orangeFD5E67 = Color(0xFFFD5E67);
  static const orangeFFEFEF = Color(0xFFFFEFEF);
  static const orangeF6E8DB = Color(0xFFF6E8DB);
  static const orange421F10 = Color(0xFF421F10);

  //根据十六进制颜色值 + 不透明度生成颜色
  static Color colorWithHexAlpha(String hexColor, double alpha) {
    int colorValue = int.parse(hexColor.replaceFirst('#', ''), radix: 16);
    int alphaValue = (alpha * 255).toInt();
    int color = alphaValue << 24 | colorValue;

    return Color(color);
  }

  ///默认下的主题
  static final ThemeData lightTheme = ThemeData(
    primarySwatch: CommonUtil.createMaterialColor(norMainThemeColors),
    highlightColor: norWhite01Color,
    splashColor: Colors.transparent,
    focusColor: norWhite01Color,
    hoverColor: norWhite01Color,
    colorScheme: const ColorScheme.light(
      primary: norMainThemeColors,
      surface: norWhite01Color,
      secondary: norMainThemeColors,
    ),
    textTheme: const TextTheme(
      //设置Material的默认字体样式
      bodyMedium: TextStyle(color: Color.fromRGBO(136, 136, 136, 1), fontSize: 16.0),
    ),
    useMaterial3: false,
  );

  //暗黑模式
  static final ThemeData darkTheme = ThemeData(
    primarySwatch: CommonUtil.createMaterialColor(norMainThemeColors),
    colorScheme: const ColorScheme.dark(
      primary: norMainThemeColors,
      surface: norBlackColors,
      secondary: norMainThemeColors,
    ),
    textTheme: const TextTheme(
      //设置Material的默认字体样式
      bodyMedium: TextStyle(color: Color.fromRGBO(136, 136, 136, 1), fontSize: 16),
    ),
    useMaterial3: false,
  );
}
